<script type="text/javascript">
	$(document).ready(function(){
		$.validator.messages.required = "";
		$.validator.messages.date = "";
		$("#FormSua").validate();
	});
</script>
<?php
	// Lấy mã sách từ thanh địa chỉ
	$id = $_GET['id'];
	
	$hocsinh = new hocsinhbs();
	$hocsinh->MaHocSinh = $id;
	$danhsach = $hocsinh->GetList();
?>
<h3>Sửa thông tin học sinh <?php echo $danhsach[0]['HoTen']; ?> </h3>
<form id="FormSua" action="index.php?do=hocsinh_sua_xuly" method="post">
	<input type="hidden" value="<?php echo $id; ?>" name="MaHocSinh" />
	<table class="Form">
		<tr>
			<td>Tên học sinh:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['HoTen']; ?>" name="HoTen" /><span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td>Địa chỉ:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['DiaChi']; ?>" name="DiaChi" /><span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td>Điện thoại:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['DienThoai']; ?>" name="DienThoai" /><span class="requirefield">*</span></td>
		</tr>
        
        <tr>
			<td>Phái:</td>
			<td> <?php
            		if(strcmp( $danhsach[0]['Phai'], "Nam") == 0)
					{
						echo '<select name="Phai" class="required">
            	<option value="Nam" selected="selected">Nam</option>
                <option value="Nữ">Nữ</option>
                </select>';
					}else
					{
						echo '<select name="Phai" class="required">
            	<option value="Nam">Nam</option>
                <option value="Nữ" selected="selected">Nữ</option>
                </select>';
					}
				?><span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td>Ngày sinh:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['NgaySinh']; ?>" name="NgaySinh" /><span class="requirefield">*</span></td>
		</tr>
        
        <tr>
			<td>Dân tộc:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['DanToc']; ?>" name="DanToc" /><span class="requirefield">*</span></td>
		</tr>
 
        <tr>
			<td>Ghi chú:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['GhiChu']; ?>" name="GhiChu" /><span class="requirefield">*</span></td>
		</tr>
        
	</table>
	<p class="GhiChuBatBuoc">(*): Trường bắt buộc phải nhập thông tin.</p>
	<input type="submit" value="Cập nhật vào CSDL" />
</form>
